gtk4.git
6 years agoAvoid a few state changes
Timm Bäder [Tue, 17 Dec 2019 16:15:17 +0000 (17:15 +0100)]
Avoid a few state changes

We can't optimize the save/restore calls away in the snapshot code, so
do it from the caller side.

6 years agogl renderer: Move more work to the vertex shaders
Timm Bäder [Tue, 17 Dec 2019 15:46:05 +0000 (16:46 +0100)]
gl renderer: Move more work to the vertex shaders

6 years agogl renderer: Don't invert offset value twice
Timm Bäder [Tue, 17 Dec 2019 15:24:17 +0000 (16:24 +0100)]
gl renderer: Don't invert offset value twice

6 years agogl renderer: Remove unused variable from shader
Timm Bäder [Tue, 17 Dec 2019 15:13:12 +0000 (16:13 +0100)]
gl renderer: Remove unused variable from shader

6 years agogl renderer: Move color computation to vertex shader
Timm Bäder [Tue, 17 Dec 2019 15:06:28 +0000 (16:06 +0100)]
gl renderer: Move color computation to vertex shader

6 years agogl renderer: Move final color computation to vertex shader
Timm Bäder [Tue, 17 Dec 2019 14:59:42 +0000 (15:59 +0100)]
gl renderer: Move final color computation to vertex shader

.. of the coloring program, which is used all the time for text.

6 years agogl renderer: Compute final color in vertex shader
Timm Bäder [Tue, 17 Dec 2019 14:55:24 +0000 (15:55 +0100)]
gl renderer: Compute final color in vertex shader

This is a very often used shader. No need to to do this for every
fragment.

6 years agosupp: Ignore calloc in the AMD driver
Timm Bäder [Tue, 17 Dec 2019 12:20:39 +0000 (13:20 +0100)]
supp: Ignore calloc in the AMD driver

What'cha gonna do

6 years agotestentryicons: Fix a memory leak
Timm Bäder [Tue, 17 Dec 2019 12:20:28 +0000 (13:20 +0100)]
testentryicons: Fix a memory leak

6 years agogl renderer: Avoid an invalid read
Timm Bäder [Tue, 17 Dec 2019 12:06:02 +0000 (13:06 +0100)]
gl renderer: Avoid an invalid read

We need to copy the color here, since the program state can live across
frame boundaries.

6 years agogl renderer: Remove some unneeded calculations from shaders
Timm Bäder [Tue, 17 Dec 2019 11:39:36 +0000 (12:39 +0100)]
gl renderer: Remove some unneeded calculations from shaders

6 years agogl renderer: Shuffle things around a bit
Timm Bäder [Tue, 17 Dec 2019 11:27:35 +0000 (12:27 +0100)]
gl renderer: Shuffle things around a bit

6 years agogl renderer: Move work to the gradient vertex shader
Timm Bäder [Tue, 17 Dec 2019 11:20:18 +0000 (12:20 +0100)]
gl renderer: Move work to the gradient vertex shader

No need to do this stuff once per fragment.

6 years agogl renderer: Add some in/out compat glue to the shaders
Timm Bäder [Tue, 17 Dec 2019 11:19:37 +0000 (12:19 +0100)]
gl renderer: Add some in/out compat glue to the shaders

so we can use _IN_ and _OUT_ and get the right things for
desktop/es/legacy GL.

6 years agogl renderer: Upload GL_RGBA texture data in GLES
Timm Bäder [Tue, 17 Dec 2019 08:14:54 +0000 (09:14 +0100)]
gl renderer: Upload GL_RGBA texture data in GLES

Colored icons are still broken this way, but at least they show up and
text works.

6 years agogltextureatlas: Use more correct debug name for texture
Timm Bäder [Tue, 17 Dec 2019 08:07:34 +0000 (09:07 +0100)]
gltextureatlas: Use more correct debug name for texture

These aren't all glyph atlases anymore.

6 years agoGdkGLContext: check for GL_KHR_debug for GL debug output
Timm Bäder [Tue, 17 Dec 2019 08:06:15 +0000 (09:06 +0100)]
GdkGLContext: check for GL_KHR_debug for GL debug output

This is available in GLES.

6 years agogl renderer: Mark beginning of frame if DEBUG_OPS is set
Timm Bäder [Mon, 16 Dec 2019 06:34:35 +0000 (07:34 +0100)]
gl renderer: Mark beginning of frame if DEBUG_OPS is set

6 years agogl renderer: Trivial declaration reorder
Timm Bäder [Mon, 16 Dec 2019 06:13:37 +0000 (07:13 +0100)]
gl renderer: Trivial declaration reorder

6 years agogl renderer: Remove a few outdated comments
Timm Bäder [Mon, 16 Dec 2019 06:01:34 +0000 (07:01 +0100)]
gl renderer: Remove a few outdated comments

6 years agogl renderer: Remove unused translation handling
Timm Bäder [Mon, 16 Dec 2019 05:41:07 +0000 (06:41 +0100)]
gl renderer: Remove unused translation handling

6 years agogl renderer: Don't copy matrix/offset of color matrix nodes into ops
Timm Bäder [Mon, 16 Dec 2019 05:32:36 +0000 (06:32 +0100)]
gl renderer: Don't copy matrix/offset of color matrix nodes into ops

6 years agogl renderer: Initialize alpha uniform to 1.0
Timm Bäder [Mon, 16 Dec 2019 05:29:01 +0000 (06:29 +0100)]
gl renderer: Initialize alpha uniform to 1.0

This makes gl-legacy work and gl-gles work except for text and icons.

6 years agogl renderer: Make RoundedRect work in gles
Timm Bäder [Mon, 16 Dec 2019 05:16:26 +0000 (06:16 +0100)]
gl renderer: Make RoundedRect work in gles

Which can't return struct types containing arrays. So let's revert to
the previous version but still send the rect along as a vec4[3];

6 years agogl renderer: Rewrite shader builder
Timm Bäder [Sat, 14 Dec 2019 21:06:12 +0000 (22:06 +0100)]
gl renderer: Rewrite shader builder

Use a unified approach to write both vertex and fragment shader in the
same file.

6 years agogl renderer: Fix program uniform updating code
Timm Bäder [Sat, 14 Dec 2019 14:43:12 +0000 (15:43 +0100)]
gl renderer: Fix program uniform updating code

This breaks the initial uniform value, but we will fix that in a later
commit in a different way.

6 years agogl renderer: Only send clip corners if we need to
Timm Bäder [Sat, 14 Dec 2019 14:41:32 +0000 (15:41 +0100)]
gl renderer: Only send clip corners if we need to

We change the clip bounds a lot more ofthen than the clip corners and
they are already split up in the shader, so only send the corners if we
need to.

6 years agogl renderer: Fix color comparison
Timm Bäder [Sat, 14 Dec 2019 14:14:15 +0000 (15:14 +0100)]
gl renderer: Fix color comparison

6 years agogl renderer: Shorten debug output impl
Timm Bäder [Sat, 14 Dec 2019 13:33:38 +0000 (14:33 +0100)]
gl renderer: Shorten debug output impl

This will leak a string but WHATEVER.

6 years agogl renderer: Fix debug color output
Timm Bäder [Sat, 14 Dec 2019 13:33:17 +0000 (14:33 +0100)]
gl renderer: Fix debug color output

6 years ago gl renderer: Rewort passing rounded rects to shaders
Timm Bäder [Sat, 14 Dec 2019 12:53:59 +0000 (13:53 +0100)]
  gl renderer: Rewort passing rounded rects to shaders

6 years agogl renderer: Don't copy border outline corner sizes around
Timm Bäder [Wed, 11 Dec 2019 17:24:35 +0000 (18:24 +0100)]
gl renderer: Don't copy border outline corner sizes around

We already offset + scale the outline and its corners, just pass those
directly to the shader.

6 years agogl renderer: stop copying current color around
Timm Bäder [Tue, 10 Dec 2019 14:08:47 +0000 (15:08 +0100)]
gl renderer: stop copying current color around

Just use a pointer now.

6 years agogl renderer: remove a memory leak
Timm Bäder [Tue, 10 Dec 2019 13:49:30 +0000 (14:49 +0100)]
gl renderer: remove a memory leak

6 years agoGdkRGBA: Use floats instead of doubles
Timm Bäder [Tue, 10 Dec 2019 13:22:52 +0000 (14:22 +0100)]
GdkRGBA: Use floats instead of doubles

6 years agoprogressbar: Remove unnecessary snapshot implementation
Timm Bäder [Mon, 9 Dec 2019 10:58:52 +0000 (11:58 +0100)]
progressbar: Remove unnecessary snapshot implementation

6 years agogl renderer: Split blurring a node into its own function
Timm Bäder [Sat, 7 Dec 2019 12:11:07 +0000 (13:11 +0100)]
gl renderer: Split blurring a node into its own function

6 years agogl renderer: Remove some unused uniforms
Timm Bäder [Wed, 11 Dec 2019 07:38:57 +0000 (08:38 +0100)]
gl renderer: Remove some unused uniforms

6 years agogl renderer: Drop a dead if statement
Timm Bäder [Tue, 3 Dec 2019 15:16:18 +0000 (16:16 +0100)]
gl renderer: Drop a dead if statement

We already handle this earlier.

6 years agoUpdate Catalan translation
Jordi Mas [Mon, 6 Jan 2020 19:36:28 +0000 (20:36 +0100)]
Update Catalan translation

6 years agowidget: Remove an unused signal
Matthias Clasen [Sun, 5 Jan 2020 14:19:29 +0000 (09:19 -0500)]
widget: Remove an unused signal

HIERARCHY_CHANGED is no longer used.

6 years agowayland: Remove debug spew
Matthias Clasen [Sun, 5 Jan 2020 14:18:10 +0000 (09:18 -0500)]
wayland: Remove debug spew

6 years agoMerge branch 'wayland-dnd-fixes' into 'master'
Matthias Clasen [Mon, 6 Jan 2020 05:44:33 +0000 (05:44 +0000)]
Merge branch 'wayland-dnd-fixes' into 'master'

Wayland dnd fixes

See merge request GNOME/gtk!1284

6 years agoUpdate Polish translation
Piotr Drąg [Sun, 5 Jan 2020 16:27:40 +0000 (17:27 +0100)]
Update Polish translation

6 years agowayland: Don't artificially prefer ASK
Matthias Clasen [Sat, 4 Jan 2020 16:07:54 +0000 (11:07 -0500)]
wayland: Don't artificially prefer ASK

We were always adding ASK to the list of possible
actions, and preferring it. This was causing the
ask cursor to show up when both the source and
the target support ASK, even though it is only
meant to happen if you hold the Alt modifier.

Instead, use one of the supported actions as
preferred action.

6 years agodocs: Small clarifications to DND docs
Matthias Clasen [Sat, 4 Jan 2020 17:06:36 +0000 (12:06 -0500)]
docs: Small clarifications to DND docs

Clear up the documentation around ASK handling
a bit.

6 years agowayland: Minor cleanup
Matthias Clasen [Sat, 4 Jan 2020 15:37:58 +0000 (10:37 -0500)]
wayland: Minor cleanup

Stop storing selected_action, mainly since the name
is confusing. Instead, just pass the value directly
in the 2 places where it is used.

6 years agowayland: Fix action handling more
Matthias Clasen [Sat, 4 Jan 2020 14:16:26 +0000 (09:16 -0500)]
wayland: Fix action handling more

When updating GdkDrop::actions from changes sent by
the compositor, we were inadvertently setting them to 0,
causing drops to appear impossible.

6 years agowayland: Finish pending offer handling
Matthias Clasen [Sat, 4 Jan 2020 14:14:33 +0000 (09:14 -0500)]
wayland: Finish pending offer handling

When creating a new GdkDrop object on drag_enter, take pending
source_actions and action into account. The code to store the
pending actions was already there, they were just not passed
on to the drop object when we create it.

6 years agowayland: Clean up drags
Matthias Clasen [Sat, 4 Jan 2020 05:12:57 +0000 (00:12 -0500)]
wayland: Clean up drags

We need to set the drag to NULL in gdk_wayland_drag_drop_done,
otherwise, all future drags will be considered local after the
first local one. Worse, they will also provide the wrong data.

6 years agoAdwaita: Make dnd marks in text views green
Matthias Clasen [Fri, 3 Jan 2020 17:45:20 +0000 (12:45 -0500)]
Adwaita: Make dnd marks in text views green

We already do this in entries, this just updates
text views to match.

6 years agotextview: Render visible marks better
Matthias Clasen [Fri, 3 Jan 2020 17:43:30 +0000 (12:43 -0500)]
textview: Render visible marks better

The only other visible mark that is in common use
besides insert and selection_bound is dnd_mark, and
we don't want it to blink or be affected by 'cursor'
visibility.

Therefore, cache not just the cursor positions, but
also whether they are insert or selection_bound,
and take that into account when rendering them.

6 years agoMerge branch 'remove-xim' into 'master'
Matthias Clasen [Fri, 3 Jan 2020 17:56:26 +0000 (17:56 +0000)]
Merge branch 'remove-xim' into 'master'

Remove the XIM input method

See merge request GNOME/gtk!1195

6 years agoAdd a text view mark/cursor test
Matthias Clasen [Fri, 3 Jan 2020 15:14:19 +0000 (10:14 -0500)]
Add a text view mark/cursor test

This has testcases for some issues around invalidation
of marks.

6 years agoFix the previous commit
Matthias Clasen [Thu, 2 Jan 2020 05:43:27 +0000 (00:43 -0500)]
Fix the previous commit

We need to actually use the right coordinates.

6 years agostackswitcher: Fix switch-while-drag functionality
Matthias Clasen [Thu, 2 Jan 2020 05:24:54 +0000 (00:24 -0500)]
stackswitcher: Fix switch-while-drag functionality

6 years agodnd: Be safer
Matthias Clasen [Tue, 31 Dec 2019 21:03:33 +0000 (16:03 -0500)]
dnd: Be safer

The contents of the selection are documented
to not be NULL if size is non-negative. So
use an empty string instead of NULL for size 0,
avoiding a crash.

6 years agowayland: Fix dnd type negotiation
Matthias Clasen [Tue, 31 Dec 2019 02:14:17 +0000 (21:14 -0500)]
wayland: Fix dnd type negotiation

We need to call gdk_content_formats_union_serialize_mime_types
like GdkClipboard does, in order to get mime types that we can
sent out.

6 years agocontentprovider: cosmetic fix
Matthias Clasen [Wed, 1 Jan 2020 17:10:02 +0000 (12:10 -0500)]
contentprovider: cosmetic fix

6 years agocontentserializer: Fix an annotation
Matthias Clasen [Tue, 31 Dec 2019 02:13:27 +0000 (21:13 -0500)]
contentserializer: Fix an annotation

6 years agoUpdated Spanish translation
Daniel Mustieles [Tue, 31 Dec 2019 07:45:12 +0000 (08:45 +0100)]
Updated Spanish translation

6 years agoMerge branch 'drag-icon' into 'master'
Matthias Clasen [Mon, 30 Dec 2019 21:20:26 +0000 (21:20 +0000)]
Merge branch 'drag-icon' into 'master'

Drag icon

See merge request GNOME/gtk!1274

6 years agomountoperation: Handle D-Bus missing
Matthias Clasen [Mon, 30 Dec 2019 20:24:51 +0000 (15:24 -0500)]
mountoperation: Handle D-Bus missing

Still not great to make sync calls here, but
at least we should handle failure without criticals.

6 years agoMerge branch 'fix-dnd' into 'master'
Matthias Clasen [Mon, 30 Dec 2019 17:12:30 +0000 (17:12 +0000)]
Merge branch 'fix-dnd' into 'master'

Fix dnd

See merge request GNOME/gtk!1273

6 years agowayland: Pass root coordinates for dnd events
Matthias Clasen [Mon, 30 Dec 2019 17:00:53 +0000 (12:00 -0500)]
wayland: Pass root coordinates for dnd events

That is what the api currently requires, so provide it.

This fixes DND to work again, for the most part.

6 years agogdk: Populate dnd event coords
Matthias Clasen [Mon, 30 Dec 2019 16:58:11 +0000 (11:58 -0500)]
gdk: Populate dnd event coords

The GdkDrop emit... apis take root coordinates.
That should be changed to surface coordinates,
eventually. For now, make the functions fill
the x, y fields.

6 years agogdk: Fix coordinates in dnd events
Matthias Clasen [Mon, 30 Dec 2019 16:56:49 +0000 (11:56 -0500)]
gdk: Fix coordinates in dnd events

Don't store coordinates as shorts. Use doubles,
as everywhere else. Also add x, y in addition
to x_root, y_root, and actually return those
in gdk_event_get_coords.

6 years agoUpdate POTFILES.in
Piotr Drąg [Mon, 30 Dec 2019 16:30:18 +0000 (17:30 +0100)]
Update POTFILES.in

6 years agotooltip: Never set a window to be its own parent
Matthias Clasen [Mon, 30 Dec 2019 14:52:13 +0000 (09:52 -0500)]
tooltip: Never set a window to be its own parent

We do get events on the tooltip window too, and
we better ignore them, or bad things may happen,
such as widgets that are their own parents and
cause infinite loops.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2339
6 years agotooltipwindow: Cosmetic fix
Matthias Clasen [Mon, 30 Dec 2019 03:47:49 +0000 (22:47 -0500)]
tooltipwindow: Cosmetic fix

6 years agoRevert "Updated Spanish translation"
Daniel Mustieles García [Mon, 30 Dec 2019 13:59:22 +0000 (13:59 +0000)]
Revert "Updated Spanish translation"

This reverts commit 62b95e33b8c27be806880239aaaeb270bf323523

6 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 30 Dec 2019 11:53:45 +0000 (12:53 +0100)]
Updated Spanish translation

6 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 30 Dec 2019 11:52:55 +0000 (12:52 +0100)]
Updated Spanish translation

6 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 30 Dec 2019 11:52:01 +0000 (12:52 +0100)]
Updated Spanish translation

6 years agoRemove gtk_window_set_hardcoded_surface
Matthias Clasen [Mon, 30 Dec 2019 05:31:32 +0000 (00:31 -0500)]
Remove gtk_window_set_hardcoded_surface

It is not used anymore.

6 years agocontainer: Be more careful with roots
Matthias Clasen [Mon, 30 Dec 2019 05:26:39 +0000 (00:26 -0500)]
container: Be more careful with roots

We were warning if we hit non-container
roots. Instead, call suitable naive api.

6 years agowidget: Be more careful with roots
Matthias Clasen [Mon, 30 Dec 2019 05:24:32 +0000 (00:24 -0500)]
widget: Be more careful with roots

We were assuming that all roots are windows,
and calling GtkWindow apis on them.

6 years agodnd: Use GtkDragIcon
Matthias Clasen [Mon, 30 Dec 2019 05:24:13 +0000 (00:24 -0500)]
dnd: Use GtkDragIcon

Use the new GtkDragIcon instead of a window
of type GTK_WINDOW_POPUP and
gtk_window_set_hardcoded_surface.

6 years agoAdd GtkDragIcon
Matthias Clasen [Mon, 30 Dec 2019 03:47:26 +0000 (22:47 -0500)]
Add GtkDragIcon

This is a GtkRoot implemntation for drag icons,
using the surface provided by GdkDrag. This lets
us avoid GTK_WINDOW_POPUP and
gtk_window_set_hardcoded_surface.

6 years agotooltipwindow: Cosmetic fix
Matthias Clasen [Mon, 30 Dec 2019 03:47:49 +0000 (22:47 -0500)]
tooltipwindow: Cosmetic fix

6 years agoMerge branch 'tooltip-redo' into 'master'
Matthias Clasen [Mon, 30 Dec 2019 03:24:58 +0000 (03:24 +0000)]
Merge branch 'tooltip-redo' into 'master'

Tooltip redo

See merge request GNOME/gtk!1271

6 years agodocs: Mention custom tooltip windows in the migration guide
Matthias Clasen [Mon, 30 Dec 2019 01:57:05 +0000 (20:57 -0500)]
docs: Mention custom tooltip windows in the migration guide

These no longer exist.

6 years agotooltips: Stop using GTK_WINDOW_POPUP
Matthias Clasen [Sun, 29 Dec 2019 02:04:19 +0000 (21:04 -0500)]
tooltips: Stop using GTK_WINDOW_POPUP

Make GtkTooltipWindow a GtkNative implementation,
instead of using a GTK_WINDOW_POPUP window.

6 years agotesttooltips: Test tooltips on popovers
Matthias Clasen [Sun, 29 Dec 2019 04:16:57 +0000 (23:16 -0500)]
testtooltips: Test tooltips on popovers

They do not currently work right.

6 years agoDrop custom tooltip windows
Matthias Clasen [Sun, 29 Dec 2019 03:36:35 +0000 (22:36 -0500)]
Drop custom tooltip windows

We want to put tooltips into something other than
windows, so this needs to go. Custom widgets are
still possible.

6 years agoMerge branch 'kill-tree-menu' into 'master'
Matthias Clasen [Mon, 30 Dec 2019 01:46:29 +0000 (01:46 +0000)]
Merge branch 'kill-tree-menu' into 'master'

Menu removal, part 2

See merge request GNOME/gtk!1270

6 years agodocs: Touch up menu button docs
Matthias Clasen [Mon, 30 Dec 2019 01:16:52 +0000 (20:16 -0500)]
docs: Touch up menu button docs

6 years agodocs: Mention the demise of menus in the migration guide
Matthias Clasen [Mon, 30 Dec 2019 00:52:22 +0000 (19:52 -0500)]
docs: Mention the demise of menus in the migration guide

This needs more details, but it is a start.

Also add sections about grabs and about toolbar
overflow handling.

6 years agodocs: Rewrite popover menu docs
Matthias Clasen [Mon, 30 Dec 2019 00:44:31 +0000 (19:44 -0500)]
docs: Rewrite popover menu docs

These were outdated and did not reflect current api.

6 years agotreeview: Use a popover for search
Matthias Clasen [Sat, 28 Dec 2019 17:57:17 +0000 (12:57 -0500)]
treeview: Use a popover for search

This is a more modern way of doing things, and avoids a window
of type GTK_WINDOW_POPUP. With a popover, it doesn't make sense
to have a positioning function, so remove that api.

6 years agowin32: Use a regular window for printing
Matthias Clasen [Sat, 28 Dec 2019 16:55:12 +0000 (11:55 -0500)]
win32: Use a regular window for printing

We never show this window, so it should not matter.
Ideally, we'd just create a surface to get handle,
anyway.

6 years agoRemove gdk_seat_grab
Matthias Clasen [Sat, 28 Dec 2019 14:12:33 +0000 (09:12 -0500)]
Remove gdk_seat_grab

We are no longer using free-standing grabs
in GTK. The replacement is the autohide
functionality of popup surfaces.

6 years agoaccelcellrenderer: Stop grabbing
Matthias Clasen [Sat, 28 Dec 2019 14:02:51 +0000 (09:02 -0500)]
accelcellrenderer: Stop grabbing

Standalone grabs are going away.

6 years agoaccelcellrenderer: Fix editing
Matthias Clasen [Sat, 28 Dec 2019 06:42:11 +0000 (01:42 -0500)]
accelcellrenderer: Fix editing

6 years agogtk: Remove menu code
Matthias Clasen [Fri, 27 Dec 2019 13:46:08 +0000 (08:46 -0500)]
gtk: Remove menu code

GtkMenu, GtkMenuBar, GtkMenuItem and their subclasses
and supporting classes are replaced by model-based popover
implementations.

6 years agodoc: Build fixes
Matthias Clasen [Sat, 28 Dec 2019 05:27:56 +0000 (00:27 -0500)]
doc: Build fixes

6 years agodocs: Remove mentions of GtkMenuItem
Matthias Clasen [Sat, 28 Dec 2019 14:55:05 +0000 (09:55 -0500)]
docs: Remove mentions of GtkMenuItem

6 years agoaccellabel: Don't mention GtkMenuItem in the docs
Matthias Clasen [Sat, 28 Dec 2019 14:59:38 +0000 (09:59 -0500)]
accellabel: Don't mention GtkMenuItem in the docs

6 years agolabel: Stop referring to GtkMenuItem in the docs
Matthias Clasen [Sat, 28 Dec 2019 14:53:49 +0000 (09:53 -0500)]
label: Stop referring to GtkMenuItem in the docs

6 years agobuildertool: Drop menu properties
Matthias Clasen [Sat, 28 Dec 2019 14:52:06 +0000 (09:52 -0500)]
buildertool: Drop menu properties